import request from '@/utils/request'

// 查询资产调拨列表
export function listAllot(query) {
  return request({
    url: '/eam/allot/list',
    method: 'get',
    params: query
  })
}

// 查询资产调拨详细
export function getAllot(allotId) {
  return request({
    url: '/eam/allot/' + allotId,
    method: 'get'
  })
}

// 新增资产调拨
export function addAllotH(data) {
  return request({
    url: '/eam/allot/addAllotH',
    method: 'post',
    data: data
  })
}

// 新增借用归还
export function addAllotD(data) {
  return request({
    url: '/eam/allot/addAllotD',
    method: 'post',
    data: data
  })
}

// 修改资产调拨
export function updateAllot(data) {
  return request({
    url: '/eam/allot',
    method: 'put',
    data: data
  })
}

// 修改调拨资产
export function updateAllotAsset(data) {
  return request({
    url: '/eam/allot/editD',
    method: 'post',
    data: data
  })
}

// 删除资产调拨
export function delAllot(allotId) {
  return request({
    url: '/eam/allot/' + allotId,
    method: 'delete'
  })
}

// 查询资产类别列表
export const getTypeList = (query) => {
  return request({
    url: '/eam/loanBack/typeList/',
    method: 'get',
    params:query
  })
}

// 查询资产列表
export const getEamList = (query) => {
  return request({
    url: '/eam/asset/list/',
    method: 'get',
    params:query
  })
}

export function deptByUserId(query) {
  return request({
    url: '/eam/loanBack/deptByUserId',
    method: 'post',
    data: query
  })
}

export function editStatus(data) {
  return request({
    url: '/eam/allot/editStatus',
    method: 'post',
    data: data
  })
}
